PEP 257 – Docstring Conventions
One-line Docstrings
There’s no blank line either before or after the docstring.
Multi-line Docstrings
Multi-line docstrings consist of a summary line just like a one-line docstring, followed by a blank line, followed by a more elaborate description.
code:python
def awesome_function():
"""summary line
description
...
"""
it is important that it fits on one line and is separated from the rest of the docstring by a blank line.
Insert a blank line after all docstrings (one-line or multi-line) that document a class
クラスのdocstringのあとには空行を入れる(←blackは入れてくる)
the class’s methods are separated from each other by a single blank line, and the docstring needs to be offset from the first method by a blank line.